package com.easondongh.blog.dao;

import com.easondongh.blog.pojo.BlogGoods;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

/**
 * @author EasonDongH
 * @date 2020/4/8 20:58
 */
@Repository
public interface BlogGoodsDao extends MongoRepository<BlogGoods,String> {

    /**
     * 根据用户id和博客id查询
     * @param userId
     * @param blogId
     * @return
     */
    int countByUserIdAndBlogId(Integer userId, String blogId);

    /**
     * 根据用户id和博客id删除
     * @param userId
     * @param blogId
     * @return
     */
    int deleteByUserIdAndBlogId(Integer userId, String blogId);
}
